<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>登录</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="__INDEX__/css/mui.min.css" rel="stylesheet" />
		<link href="__INDEX__/css/Phoebe.css" rel="stylesheet"/>
		<link href="__INDEX__/css/enter.css" rel="stylesheet"/>
	</head>
	<body>
		<!--登录-->
		<div class="enter">
			<form >
				<img src="__PUBLIC__/static/images/logo.jpg" alt="" />
				<input type="text" placeholder="请输入您的手机号码" class="pnumber"  id="user_tel"/>
				<input type="password" placeholder="请输入您的密码" class="password"  id="user_password"/>
				<input type="button" value="登录" class="sumbit" style="background: " />
				<p><a href="{:url('index/retrun_pwd')}">找回密码</a></p>
			</form>
			<p><a href="regist.html">注册</a></p>
		</div>
		<script src="__TEMPLATE__/js/mui.min.js"></script>
		<script src="__PUBLIC__/static/js/jquery.min.js"></script>
		<script src="__PUBLIC__/static/layui/layui.all.js"></script>
		<script>
            $('.sumbit').click(function () {
				
				var user_tel 		=	$('#user_tel').val();
				var user_password	= 	$('#user_password').val();
				if(user_tel == "" || user_tel.length<2){
					layer.msg("请输入您的手机号码");
					return false;
				}
				
				if(user_password == "" || user_password<2){
					layer.msg("请输入您的密码");
					return false;
				}
				

                $.ajax({
                    url: "{:url('index/login')}",
                    type: 'post',
                    async:false,
                    data:{
                        user_tel		: user_tel,
                        user_password	: user_password
                    },
                    success:function (data) {
                       if(data.code==200){
	                    	layer.msg(data.msg, {
							  icon: 1,
							  time: 1500 //2秒关闭（如果不配置，默认是3秒）
							}, function(){
								location.href = "{:url('index/member/index')}";
							});
	                    }else{
	                    	layer.msg(data.msg);//保存成功提示
	                    }
                    },
                  	error:function(data){
                  		if(data.code==200){
	                    	layer.msg(data.msg, {
							  icon: 1,
							  time: 1500 //2秒关闭（如果不配置，默认是3秒）
							}, function(){
								location.href = "{:url('index/member/index')}";
							});
	                    }else{
	                    	layer.msg(data.msg);//保存成功提示
	                    }
                  	}
                })
            })

		</script>
	</body>

</html>